/**
 * 
 */
package com.antilia.infomaresme.pages.myitems;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;

import com.antilia.infomaresme.IProtectedPage;
import com.antilia.infomaresme.InfomaresmeApplication;
import com.antilia.infomaresme.InfomaresmeSession;
import com.antilia.infomaresme.data.dataobjects.User;
import com.antilia.infomaresme.pages.BasePage;
import com.antilia.infomaresme.pages.LogedAsPanel;
import com.antilia.infomaresme.pages.testmaps.GMap3;
import com.antilia.infomaresme.provider.UserLdm;


/**
 * @author Ernesto
 *
 */
public class ListItemsPage extends BasePage implements IProtectedPage {

	private static final long serialVersionUID = 1L;	
	
	public ListItemsPage() {
		this(new UserLdm(InfomaresmeSession.getSession().getUser()));
	}
	
	/**
	 * 
	 */
	public ListItemsPage(IModel<User> model) {
		ListItemsPanel categories = new ListItemsPanel("edit", model);
		add(categories);
	}
	
	@Override
	public void renderHead(IHeaderResponse response) {
		super.renderHead(response);
		GMap3.renderGMap(response, InfomaresmeApplication.GMAPKey, false);
	}
	
	@Override
	protected Component newRightPanel(String id) {
		return new LogedAsPanel(id);
	}
	
	@Override
	protected Component newTopMavigation(String id) {
		return new TitlePanel(id, new ResourceModel("listItemsPage"));
	}
}
